var _EsdDynamicTransformationFunction = function($){
/**
 * 命名空间定义
 */
var _EsdDynamicTransformationScript = {};
_EsdDynamicTransformationScript.navBlock = {}; // 定义区域跳转类
_EsdDynamicTransformationScript.navBlock.selector = {};
/**
 * 文本链接 a
 */
//保证所有a标签都有href
$("a").each(function(){

	var aHref = this.href;
	if( aHref=="" || aHref==undefined ){
			$(this).attr("href","javascript:void(0)");
	}
	
	//给a标签加title
	var aTitle = this.title;
	var aText = this.text;
	
	if( aTitle=="" || aTitle==undefined ){
		if( aText!="" || aText!=undefined ){
			$(this).attr("title",$.trim(aText));
		}
	}
	
});


/**
 * 图片处理片段
 */

$('img[src="./images/jcsc_jy20171106.jpg"]').attr('title','监狱人民警察誓词').attr('alt','监狱人民警察誓词');$('img[src="./images/gaba_logo.png"]').attr('title','吉公网安备标识').attr('alt','吉公网安备标识');$('img[src="./jygl/201304/W020171114532366055801.jpg"]').attr('title','敦化监狱').attr('alt','敦化监狱');$('img[src="./jygl/201308/W020171114532429349215.jpg"]').attr('title','新康医院').attr('alt','新康医院');$('img[src="./jygl/201712/W020171226324664393218.jpg"]').attr('title','兴业监狱').attr('alt','兴业监狱');$('img[src="./images/jhbs_jy20171106.jpg"]').attr('title','警衔标识').attr('alt','警衔标识');$('img[src="./jygl/201712/W020171226534880492615.jpg"]').attr('title','通化监狱').attr('alt','通化监狱');$('img[src="./images/zwgk_icon6_jy20171106.jpg"]').attr('title','领导机制').attr('alt','领导机制');$('img[src="./jygl/201308/W020171114532440708211.jpg"]').attr('title','长春监狱').attr('alt','长春监狱');$('img[src="//dcs.conac.cn/image/red.png"]').attr('title','党政机关标识').attr('alt','党政机关标识');$('img[src="./yxmf/201304/W020171114529103801963.jpg"]').attr('title','英雄模范许宏远照片').attr('alt','英雄模范许宏远照片');$('img[src="./images/jygl_jy20171106.jpg"]').attr('title','监狱概况').attr('alt','监狱概况');$('img[src="./images/yjzj_jy20171106.jpg"]').attr('title','意见征集').attr('alt','意见征集');$('img[src="./jygl/201304/W020171114532375292339.jpg"]').attr('title','吉林监狱').attr('alt','吉林监狱');$('img[src="./images/yxmf_jy20171106.jpg"]').attr('title','英雄模范').attr('alt','英雄模范');$('img[src="./yxmf/201304/W020171114529107395574.jpg"]').attr('title','英雄模范李强照片').attr('alt','英雄模范李强照片');$('img[src="./tpxw/201912/W020191225483206032051.jpg"]').attr('title','我们的中国梦 奏响新时代--吉林省女子监狱与省文化馆联合举办2020年迎新年交响音乐会').attr('alt','我们的中国梦 奏响新时代--吉林省女子监狱与省文化馆联合举办2020年迎新年交响音乐会');$('img[src="./tpxw/201912/W020191213503521650190.jpg"]').attr('title','全省监狱系统优秀年轻干部执法能力提升专题培训班圆满结束').attr('alt','全省监狱系统优秀年轻干部执法能力提升专题培训班圆满结束');$('img[src="./yqlj/201508/W020171114533711830327.jpg"]').attr('title','吉林省人民检察院标识').attr('alt','吉林省人民检察院标识');$('img[src="./images/zwgk_icon3_jy20171106.jpg"]').attr('title','政府信息公开年度报告').attr('alt','政府信息公开年度报告');$('img[src="./tpxw/201912/W020191226368040266822.jpg"]').attr('title','北京市监狱管理局考察团到四平监狱参观考察').attr('alt','北京市监狱管理局考察团到四平监狱参观考察');$('img[src="./jygl/201308/W020171114532399376082.png"]').attr('title','延吉监狱').attr('alt','延吉监狱');$('img[src="./jygl/201712/W020171228372033011957.jpg"]').attr('title','铁北监狱').attr('alt','铁北监狱');$('img[src="./jygl/201308/W020171114532401661925.jpg"]').attr('title','辽源市监狱').attr('alt','辽源市监狱');$('img[src="./images/zwgk_icon5_jy20171106.jpg"]').attr('title','权责清单').attr('alt','权责清单');$('img[src="./yxmf/201304/W020171114529104769619.jpg"]').attr('title','英雄模范朴昌浩照片').attr('alt','英雄模范朴昌浩照片');$('img[src="./jygl/201308/W020190710314434422665.jpg"]').attr('title','北湖监狱').attr('alt','北湖监狱');$('img[src="./images/zxzx_jy20171106.jpg"]').attr('title','在线咨询').attr('alt','在线咨询');$('img[src="./jygl/201308/W020171114532396370077.jpg"]').attr('title','镇赉分局').attr('alt','镇赉分局');$('img[src="./tpxw/201912/W020191213521417008157.jpg"]').attr('title','吉林省监狱管理局召开2019年第十一次党组理论学习中心组集体学习(扩大)会议').attr('alt','吉林省监狱管理局召开2019年第十一次党组理论学习中心组集体学习(扩大)会议');$('img[src="./images/jzxx_jy20171106.jpg"]').attr('title','局长信箱').attr('alt','局长信箱');$('img[src="./yqlj/201508/W020171114533712597169.jpg"]').attr('title','吉林法院网标识').attr('alt','吉林法院网标识');$('img[src="./yxmf/201304/W020171114529101168457.jpg"]').attr('title','英雄模范张立平照片').attr('alt','英雄模范张立平照片');$('img[src="./images/zwgk_icon4_jy20171106.jpg"]').attr('title','依申请公开').attr('alt','依申请公开');$('img[src="./images/zwgk_icon1_jy20171106.jpg"]').attr('title','政府信息公开').attr('alt','政府信息公开');$('img[src="./jygl/201712/W020171222445596626638.jpg"]').attr('title','江城监狱').attr('alt','江城监狱');$('img[src="./jygl/201308/W020171114532417111065.jpg"]').attr('title','铁北监狱').attr('alt','铁北监狱');$('img[src="./images/xxcx_jy20171106.jpg"]').attr('title','服刑人员信息查询').attr('alt','服刑人员信息查询');$('img[src="./jygl/201308/W020171114532408767306.jpg"]').attr('title','女子监狱').attr('alt','女子监狱');$('img[src="./tpxw/201912/W020191203555157814440.jpg"]').attr('title','吉林省监狱数聚智慧安防指挥系统9.0版荣获司法部“数字法治、智慧司法”信息化优秀示范案例大比武二等奖').attr('alt','吉林省监狱数聚智慧安防指挥系统9.0版荣获司法部“数字法治、智慧司法”信息化优秀示范案例大比武二等奖');$('img[src="./jygl/201308/W020171114532420853855.jpg"]').attr('title','通化监狱').attr('alt','通化监狱');$('img[src="./jygl/201308/W020171114532382971729.jpg"]').attr('title','白城监狱').attr('alt','白城监狱');$('img[src="./jygl/201308/W020190709510050246067.jpg"]').attr('title','四平监狱').attr('alt','四平监狱');$('img[src="./images/zwgk_icon2_jy20171106.jpg"]').attr('title','政务信息公开指南').attr('alt','政务信息公开指南');$('img[src="./jygl/201308/W020171114532425185212.jpg"]').attr('title','未管所').attr('alt','未管所');$('img[src="./jygl/201712/W020171226556207849021.jpg"]').attr('title','长春监狱').attr('alt','长春监狱');$('img[src="./jygl/201712/W020171227553165927427.jpg"]').attr('title','宁江监狱').attr('alt','宁江监狱');$('img[src="./jygl/201308/W020171114532436959122.jpg"]').attr('title','英城监狱').attr('alt','英城监狱');$('img[src="./jygl/201308/W020171114532405479240.jpg"]').attr('title','梅河监狱').attr('alt','梅河监狱');$('img[src="./jygl/201712/W020171225406600069212.jpg"]').attr('title','吉林监狱').attr('alt','吉林监狱');$('img[src="./jygl/201308/W020171114532392328873.jpg"]').attr('title','江城监狱').attr('alt','江城监狱');$('img[src="./images/weixin2_jy20171106.jpg"]').attr('title','微信公众号二维码').attr('alt','微信公众号二维码');$('img[src="./yqlj/201508/W020171114533710394716.jpg"]').attr('title','中国文明网标识').attr('alt','中国文明网标识');$('img[src="./jygl/201308/W020171114532433211231.jpg"]').attr('title','兴业监狱').attr('alt','兴业监狱');$('img[src="./yxmf/201303/W020171114529099792007.jpg"]').attr('title','英雄模范高宣文照片').attr('alt','英雄模范高宣文照片');$('img[src="./jygl/201304/W020171114532370702557.jpg"]').attr('title','公主岭监狱').attr('alt','公主岭监狱');$('img[src="./yxmf/201304/W020171114529106408374.jpg"]').attr('title','英雄模范梅国刚照片').attr('alt','英雄模范梅国刚照片');$('img[src="./yqlj/201805/W020180503336260994771.jpg"]').attr('title','中华人民共和国司法部标识').attr('alt','中华人民共和国司法部标识');$('img[src="./jygl/201304/W020171114532379081827.jpg"]').attr('title','净月监狱').attr('alt','净月监狱');$('img[src="./yqlj/201508/W020171114533711155235.jpg"]').attr('title','吉林省公安厅标识').attr('alt','吉林省公安厅标识');

//img
$("img").each(function(){
	//给图片加alt/title
	var imgAlt = this.alt,
		imgTitle = this.title,
		imgSrc = this.src,
		parentText = this.parentElement.text;

	if(this.alt=="" || this.alt==undefined){
		if(imgTitle!="" && imgTitle!=undefined){
			$(this).attr("alt",imgTitle);
		}else if(parentText!="" && parentText!=undefined){
			$(this).attr("alt",parentText);
		}
	}
	if(this.title=="" || this.title==undefined){
		if(imgAlt!="" && imgAlt!=undefined){
			$(this).attr("title",imgAlt);
		}else if(parentText!="" && parentText!=undefined){
			$(this).attr("title",parentText);
		}
	}
})

$("img").each(function(){
	if( (this.alt=="" && this.title=="")||(this.alt==undefined && this.title==undefined) ){
		$(this).attr("title","图片");
		$(this).attr("alt","图片");
	}
})
/**
 * 共通头部
 */
$("#keyword").attr({
	placeholder : "请输入您要查找的内容",
	title : "请输入您要查找的内容"
});
$(".searchbtn").attr({
	placeholder : "搜索",
	title : "搜索"
});
/**
 * 主导航
 */
if (window.location.href == 'http://jyj.jl.gov.cn/' || window.location.href == 'http://jyj.jl.gov.cn/index.html') {
	// 轮播,右下角原点--鼠标点击触发情况
	// 轮播：只获取轮播中一个a标签。
	// 以文字a标签为主，图片a标签尽量不要，title不稳定

	// 轮播前的标签
	_EsdDynamicTransformationScript.esdTagFrontNum1 = $(".ttxw .ttxw_news_list ul li:eq(2) a");
	// 文字A标签
	_EsdDynamicTransformationScript.esdTagANum1 = $("#D1pic1 .fcon:eq(0) .shadow a");
	_EsdDynamicTransformationScript.esdTagANum2 = $("#D1pic1 .fcon:eq(1) .shadow a");
	_EsdDynamicTransformationScript.esdTagANum3 = $("#D1pic1 .fcon:eq(2) .shadow a");
	_EsdDynamicTransformationScript.esdTagANum4 = $("#D1pic1 .fcon:eq(3) .shadow a");
	_EsdDynamicTransformationScript.esdTagANum5 = $("#D1pic1 .fcon:eq(4) .shadow a");

	// 原点
	_EsdDynamicTransformationScript.esdTagCircleNum1 = $("#D1fBt a:eq(0) i");
	_EsdDynamicTransformationScript.esdTagCircleNum2 = $("#D1fBt a:eq(1) i");
	_EsdDynamicTransformationScript.esdTagCircleNum3 = $("#D1fBt a:eq(2) i");
	_EsdDynamicTransformationScript.esdTagCircleNum4 = $("#D1fBt a:eq(3) i");
	_EsdDynamicTransformationScript.esdTagCircleNum5 = $("#D1fBt a:eq(4) i");

	// 轮播后的标签
	_EsdDynamicTransformationScript.esdTagAfterNum1 = $(".gzdt .gzdt_title span a");

	// 轮播前的焦点
	_EsdDynamicTransformationScript.esdTagFrontNum1.focus(function(e) {
		$(document).bind("keydown.keydown_0", function(e) {
			if (e.shiftKey && e.keyCode == 9) {

			} else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum1.click();
				_EsdDynamicTransformationScript.esdTagANum1.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagFrontNum1.blur(function() {
		$(document).unbind("keydown.keydown_0");
	});
	// 第一块
	_EsdDynamicTransformationScript.esdTagANum1.focus(function(e) {
		_EsdDynamicTransformationScript.esdTagCircleNum1.click();
		$(document).bind("keydown.keydown_1", function(e) {
			if (e.shiftKey && e.keyCode == 9) {

			} else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum2.click();
				_EsdDynamicTransformationScript.esdTagANum2.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagANum1.blur(function() {
		$(document).unbind("keydown.keydown_1");
	});
	// 第二块
	_EsdDynamicTransformationScript.esdTagANum2.focus(function(e) {
		_EsdDynamicTransformationScript.esdTagCircleNum2.click();
		$(document).bind("keydown.keydown_2", function(e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum1.click();
				_EsdDynamicTransformationScript.esdTagANum1.focus();
				return false;
			} else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum3.click();
				_EsdDynamicTransformationScript.esdTagANum3.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagANum2.blur(function() {
		$(document).unbind("keydown.keydown_2");
	});

	// 第三块
	_EsdDynamicTransformationScript.esdTagANum3.focus(function(e) {
		_EsdDynamicTransformationScript.esdTagCircleNum3.click();
		$(document).bind("keydown.keydown_3", function(e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum2.click();
				_EsdDynamicTransformationScript.esdTagANum2.focus();
				return false;
			} else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum4.click();
				_EsdDynamicTransformationScript.esdTagANum4.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagANum3.blur(function() {
		$(document).unbind("keydown.keydown_3");
	});
	// 第四块
	_EsdDynamicTransformationScript.esdTagANum4.focus(function(e) {
		_EsdDynamicTransformationScript.esdTagCircleNum4.click();
		$(document).bind("keydown.keydown_4", function(e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum3.click();
				_EsdDynamicTransformationScript.esdTagANum3.focus();
				return false;
			} else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum5.click();
				_EsdDynamicTransformationScript.esdTagANum5.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagANum4.blur(function() {
		$(document).unbind("keydown.keydown_4");
	});

	// 第五块
	_EsdDynamicTransformationScript.esdTagANum5.focus(function(e) {
		_EsdDynamicTransformationScript.esdTagCircleNum5.click();
		$(document).bind("keydown.keydown_5", function(e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum4.click();
				_EsdDynamicTransformationScript.esdTagANum4.focus();
				return false;
			} else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagAfterNum1.focus();
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum5.blur(function() {
		$(document).unbind("keydown.keydown_5");
	});

	// 轮播后的焦点
	_EsdDynamicTransformationScript.esdTagAfterNum1.focus(function(e) {

		$(document).bind("keydown.keydown_6", function(e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum5.click();
				_EsdDynamicTransformationScript.esdTagANum5.focus();
				return false;
			} else if (e.keyCode == 9) {

			}
		});

	});
	_EsdDynamicTransformationScript.esdTagAfterNum1.blur(function() {
		$(document).unbind("keydown.keydown_6");
	});

}
/**
 * 二级页
 */
/**
 * 主页js
 */
if (window.location.href == 'http://jyj.jl.gov.cn/' || window.location.href == 'http://jyj.jl.gov.cn/index.html') {
	_EsdDynamicTransformationScript.getIframeInfos = function(jsObj, iframeObj) {
		jsObj.aLink_num = iframeObj.contentWindow.document.getElementsByTagName("a").length;
		jsObj.first_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[0];
		jsObj.last_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[jsObj.aLink_num - 1];
		jsObj.self = iframeObj;
	};

	//将iframe所包含的a链接数 第一个a元素 最后一个a元素赋值给第一个参数的js对象
	_EsdDynamicTransformationScript.getIframeInfos = function(jsObj,iframeObj){
		if(iframeObj != undefined){
			jsObj.aLink_num = iframeObj.contentWindow.document.getElementsByTagName("a").length;
			jsObj.first_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[0];
			jsObj.last_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[jsObj.aLink_num-1];
			jsObj.self = iframeObj;
		}
	};

	//声明iframe操作对象
	_EsdDynamicTransformationScript.iframe1 = {};
	_EsdDynamicTransformationScript.iframe2 = {};

	_EsdDynamicTransformationScript.iframeElement1 = document.getElementsByTagName("iframe")[0];   // 需要修改 这里的iframe获取
	_EsdDynamicTransformationScript.iframeElement2 = document.getElementsByTagName("iframe")[1];   // 需要修改 这里的iframe获取

	// 选项卡标签 jquery对象
	_EsdDynamicTransformationScript.iframeTab1 = $(".zyxx .zyxx_title a:eq(0)"); // 需要修改
	// 这里的tab获取
	_EsdDynamicTransformationScript.iframeTab2 = $(".zyxx .zyxx_title a:eq(1)"); // 需要修改

	// 判断iframe是否有效
	if((_EsdDynamicTransformationScript.iframeElement1!=undefined) && (_EsdDynamicTransformationScript.iframeElement2!=undefined)){

		// 当iframe都加载完毕后执行代码 使用setInterval
		_EsdDynamicTransformationScript.iframeInterval = setInterval(function(){	
			
			if((_EsdDynamicTransformationScript.iframeElement1.contentWindow.document.getElementsByTagName("a")[0]!=undefined) 
					&&_EsdDynamicTransformationScript.iframeElement2.contentWindow.document.getElementsByTagName("a")[0]!=undefined ){
				clearInterval(_EsdDynamicTransformationScript.iframeInterval);
				
				//通过方法赋值   
				_EsdDynamicTransformationScript.getIframeInfos(_EsdDynamicTransformationScript.iframe1,_EsdDynamicTransformationScript.iframeElement1);  
				_EsdDynamicTransformationScript.getIframeInfos(_EsdDynamicTransformationScript.iframe2,_EsdDynamicTransformationScript.iframeElement2); 

				// 第一个标签 切换
				_EsdDynamicTransformationScript.iframeTab1.focus(function(e) {
					viewz(1);
					e = $(this).mouseover();
					$(document).bind("keydown.iframeKeydown_1", function(e) {
						if (e.shiftKey && e.keyCode == 9) {
							_EsdDynamicTransformationScript.iframeTab1.trigger("blur");
						} else if (e.keyCode == 9) {
							_EsdDynamicTransformationScript.iframeTab1.trigger("blur");
							$(_EsdDynamicTransformationScript.iframe1.self).focus();
							return false;
						}
					});
				});
				_EsdDynamicTransformationScript.iframeTab1.blur(function() {
					$(document).unbind("keydown.iframeKeydown_1");
				});
			
				// 第一个标签的第一个链接
				$(_EsdDynamicTransformationScript.iframe1.first_aLink).focus(function() {
					$(_EsdDynamicTransformationScript.iframe1.self.contentWindow.document).bind("keydown.iframeKeydown_first1", function(e) {
						if (e.shiftKey && e.keyCode == 9) {
							$(document).trigger("blur");
							_EsdDynamicTransformationScript.iframeTab1.focus();
							return false;
						} else if (e.keyCode == 9) {
						}
					});
				});
				$(_EsdDynamicTransformationScript.iframe1.first_aLink).blur(function() {
					$(_EsdDynamicTransformationScript.iframe1.self.contentWindow.document).unbind("keydown.iframeKeydown_first1");
				});
			
				// 第一个标签的最后一个链接
				$(_EsdDynamicTransformationScript.iframe1.last_aLink).focus(function() {
					$(_EsdDynamicTransformationScript.iframe1.self.contentWindow.document).bind("keydown.iframeKeydown_first1", function(e) {
						if (e.shiftKey && e.keyCode == 9) {
						} else if (e.keyCode == 9) {
							viewz(2);
							$(document).trigger("blur");
							_EsdDynamicTransformationScript.iframeTab2.focus();
							return false;
						}
					});
				});
				$(_EsdDynamicTransformationScript.iframe1.last_aLink).blur(function() {
					$(_EsdDynamicTransformationScript.iframe1.self.contentWindow.document).unbind("keydown.iframeKeydown_first1");
				});
			
				// 第二个标签切换
				_EsdDynamicTransformationScript.iframeTab2.focus(function(e) {
					e = $(this).mouseover();
					$(document).bind("keydown.iframeKeydown_2", function(e) {
						if (e.shiftKey && e.keyCode == 9) {
							viewz(1);
							_EsdDynamicTransformationScript.iframeTab2.trigger("blur");
							_EsdDynamicTransformationScript.iframeTab1.mouseover();
							$(_EsdDynamicTransformationScript.iframe1.last_aLink).focus();
							return false;
						} else if (e.keyCode == 9) {
							_EsdDynamicTransformationScript.iframeTab2.trigger("blur");
							$(_EsdDynamicTransformationScript.iframe2.self).focus();
							return false;
						}
					});
			
				});
				_EsdDynamicTransformationScript.iframeTab2.blur(function() {
					$(document).unbind("keydown.iframeKeydown_2");
				});
			}
			
		}, 500);

	}
}
/**
 * 共通底部处理
 */
/**
 * 区域导航选择器
 */

if (window.location.href == 'http://jyj.jl.gov.cn/' || window.location.href == 'http://jyj.jl.gov.cn/index.html') {

	_EsdDynamicTransformationScript.navBlock.selector.top = ".header";
	_EsdDynamicTransformationScript.navBlock.selector.nav = ".nav";
	_EsdDynamicTransformationScript.navBlock.selector.footer = ".footer";
	_EsdDynamicTransformationScript.navBlock.selector.main = ".main";

	$(".searchbox").addClass("navBlock");
	$(".nav").addClass("navBlock");
	$(".main").addClass("navBlock");
	$(".footer").addClass("navBlock");
	$(".ttxw").addClass("navBlock");
	$(".tpxw").addClass("navBlock");
	$(".gzdt").addClass("navBlock");
	$(".zyxx").addClass("navBlock");
	$(".part:eq(0) .news:eq(0)").addClass("navBlock");
	$(".jld").addClass("navBlock");
	$(".zwgk").addClass("navBlock");
	$(".zwgk_r .news:eq(0)").addClass("navBlock");
	$(".zwgk_r .news:eq(1)").addClass("navBlock");
	$(".yxmf").addClass("navBlock");
	$(".jygl").addClass("navBlock");
	$(".dwjs_l .news:eq(0)").addClass("navBlock");
	$(".dwjs_l .news:eq(1)").addClass("navBlock");
	$(".part:eq(4) .fr").addClass("navBlock");
	$(".part:eq(5)").addClass("navBlock");
	$(".positon").addClass("navBlock");
}
// -------------------------------二级页选择器------------------------------------
if (window.location.href == 'http://jyj.jl.gov.cn/jgsz/' || window.location.href == 'http://jyj.jl.gov.cn/zwgk/hyzl/' || window.location.href == 'http://jyj.jl.gov.cn/gzdt/'
		|| window.location.href == 'http://jyj.jl.gov.cn/ztbd/' || window.location.href == 'http://jyj.jl.gov.cn/gkxx/' || window.location.href == 'http://jyj.jl.gov.cn/ywgk/'
		|| window.location.href == 'http://jyj.jl.gov.cn/gsgg/' || window.location.href == 'http://jyj.jl.gov.cn/zwgk/ldjz/' || window.location.href == 'http://jyj.jl.gov.cn/dwjs/'
		|| window.location.href == 'http://jyj.jl.gov.cn/hgzl/' || window.location.href == 'http://jyj.jl.gov.cn/wshd/jzxx/' || window.location.href == 'http://jyj.jl.gov.cn/wshd/yjzj/'
		|| window.location.href == 'http://jyj.jl.gov.cn/wshd/zxzx/') {
	_EsdDynamicTransformationScript.navBlock.selector.top = ".header";
	_EsdDynamicTransformationScript.navBlock.selector.nav = ".nav";
	_EsdDynamicTransformationScript.navBlock.selector.footer = ".footer";
	_EsdDynamicTransformationScript.navBlock.selector.main = ".main";
	_EsdDynamicTransformationScript.navBlock.selector.left = ".zwgk";
	_EsdDynamicTransformationScript.navBlock.selector.right = ".zwgk_r";
	$(".searchbox").addClass("navBlock");
	$(".nav").addClass("navBlock");
	$(".main").addClass("navBlock");
	$(".footer").addClass("navBlock");
	$(".positon").addClass("navBlock");
	$(".zwgk").addClass("navBlock");
	$(".zwgk_r").addClass("navBlock");
}
/**
 * 区域导航、调试开关
 */

$(document).bind("keydown.keydown_9001", function(e) {
	if (e.shiftKey && e.keyCode == 20) {
		$("*").focus(function() {
			$(this).css({
				"outline" : "2px dashed red"
			});
		});
		$("*").blur(function() {
			$(this).css({
				"outline" : "0px black"
			});
		});
	}
});

	/**
	 * 说明： 区域跳转+区块跳转
	 * 区域跳转包括：头部区域（top），导航区域(nav)，主要区域(main){左侧区域，中间区域，右侧区域}，底部区域(footer)。
	 * 区块跳转包括：也叫栏目跳转，是对主要区域(main)内进行栏目的细分，用于盲人快速找到感兴趣的栏目。
	 * 
	 */
	// 加载必要支持库，嵌入了mousetrap代码，如需升级版本删除下载新版本后单独加载即可
	/* mousetrap v1.6.5 craig.is/killing/mice */
	(function(q,u,c){function v(a,b,g){a.addEventListener?a.addEventListener(b,g,!1):a.attachEvent("on"+b,g)}function z(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return n[a.which]?n[a.which]:r[a.which]?r[a.which]:String.fromCharCode(a.which).toLowerCase()}function F(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function w(a){return"shift"==a||"ctrl"==a||"alt"==a||
	"meta"==a}function A(a,b){var g,d=[];var e=a;"+"===e?e=["+"]:(e=e.replace(/\+{2}/g,"+plus"),e=e.split("+"));for(g=0;g<e.length;++g){var m=e[g];B[m]&&(m=B[m]);b&&"keypress"!=b&&C[m]&&(m=C[m],d.push("shift"));w(m)&&d.push(m)}e=m;g=b;if(!g){if(!p){p={};for(var c in n)95<c&&112>c||n.hasOwnProperty(c)&&(p[n[c]]=c)}g=p[e]?"keydown":"keypress"}"keypress"==g&&d.length&&(g="keydown");return{key:m,modifiers:d,action:g}}function D(a,b){return null===a||a===u?!1:a===b?!0:D(a.parentNode,b)}function d(a){function b(a){a=
	a||{};var b=!1,l;for(l in p)a[l]?b=!0:p[l]=0;b||(x=!1)}function g(a,b,t,f,g,d){var l,E=[],h=t.type;if(!k._callbacks[a])return[];"keyup"==h&&w(a)&&(b=[a]);for(l=0;l<k._callbacks[a].length;++l){var c=k._callbacks[a][l];if((f||!c.seq||p[c.seq]==c.level)&&h==c.action){var e;(e="keypress"==h&&!t.metaKey&&!t.ctrlKey)||(e=c.modifiers,e=b.sort().join(",")===e.sort().join(","));e&&(e=f&&c.seq==f&&c.level==d,(!f&&c.combo==g||e)&&k._callbacks[a].splice(l,1),E.push(c))}}return E}function c(a,b,c,f){k.stopCallback(b,
	b.target||b.srcElement,c,f)||!1!==a(b,c)||(b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation?b.stopPropagation():b.cancelBubble=!0)}function e(a){"number"!==typeof a.which&&(a.which=a.keyCode);var b=z(a);b&&("keyup"==a.type&&y===b?y=!1:k.handleKey(b,F(a),a))}function m(a,g,t,f){function h(c){return function(){x=c;++p[a];clearTimeout(q);q=setTimeout(b,1E3)}}function l(g){c(t,g,a);"keyup"!==f&&(y=z(g));setTimeout(b,10)}for(var d=p[a]=0;d<g.length;++d){var e=d+1===g.length?l:h(f||
	A(g[d+1]).action);n(g[d],e,f,a,d)}}function n(a,b,c,f,d){k._directMap[a+":"+c]=b;a=a.replace(/\s+/g," ");var e=a.split(" ");1<e.length?m(a,e,b,c):(c=A(a,c),k._callbacks[c.key]=k._callbacks[c.key]||[],g(c.key,c.modifiers,{type:c.action},f,a,d),k._callbacks[c.key][f?"unshift":"push"]({callback:b,modifiers:c.modifiers,action:c.action,seq:f,level:d,combo:a}))}var k=this;a=a||u;if(!(k instanceof d))return new d(a);k.target=a;k._callbacks={};k._directMap={};var p={},q,y=!1,r=!1,x=!1;k._handleKey=function(a,
	d,e){var f=g(a,d,e),h;d={};var k=0,l=!1;for(h=0;h<f.length;++h)f[h].seq&&(k=Math.max(k,f[h].level));for(h=0;h<f.length;++h)f[h].seq?f[h].level==k&&(l=!0,d[f[h].seq]=1,c(f[h].callback,e,f[h].combo,f[h].seq)):l||c(f[h].callback,e,f[h].combo);f="keypress"==e.type&&r;e.type!=x||w(a)||f||b(d);r=l&&"keydown"==e.type};k._bindMultiple=function(a,b,c){for(var d=0;d<a.length;++d)n(a[d],b,c)};v(a,"keypress",e);v(a,"keydown",e);v(a,"keyup",e)}if(q){var n={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",
	18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},r={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},C={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},B={option:"alt",command:"meta","return":"enter",
	escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p;for(c=1;20>c;++c)n[111+c]="f"+c;for(c=0;9>=c;++c)n[c+96]=c.toString();d.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};d.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};d.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};d.prototype.reset=function(){this._callbacks={};
	this._directMap={};return this};d.prototype.stopCallback=function(a,b){if(-1<(" "+b.className+" ").indexOf(" mousetrap ")||D(b,this.target))return!1;if("composedPath"in a&&"function"===typeof a.composedPath){var c=a.composedPath()[0];c!==a.target&&(b=c)}return"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};d.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};d.addKeycodes=function(a){for(var b in a)a.hasOwnProperty(b)&&(n[b]=a[b]);p=null};
	d.init=function(){var a=d(u),b;for(b in a)"_"!==b.charAt(0)&&(d[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};d.init();q.Mousetrap=d;"undefined"!==typeof module&&module.exports&&(module.exports=d);"function"===typeof define&&define.amd&&define(function(){return d})}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null);

	// 嵌入了mousetrap代码结束


	_EsdDynamicTransformationScript.navBlock.debug = true; // 是否是调试模式，调试模式有红边线，非调试模式关闭红边框


	_EsdDynamicTransformationScript.navBlock.selector.activate = ".navBlock"; // 激活的采用class因为会激活多个

	// 快捷键定义区
	_EsdDynamicTransformationScript.navBlock.key = {};
	/*
	 * 区域跳转JS 插件支持：jquery、mousetrap
	 * 功能：为避免与浏览器快捷键冲突默认全部采用3+1组合键（alt+ctrl+shift）+自定义键 头部区域跳转
	 * alt+ctrl+shift+T(top) 导航区域跳转 alt+ctrl+shift+N(nav) 主要区域跳转
	 * alt+ctrl+shift+M(main) 左侧区域跳转 alt+ctrl+shift+L(left) 右侧区域跳转
	 * alt+ctrl+shift+R(right) 正文区域跳转 alt+ctrl+shift+C(content) 底部区域跳转
	 * alt+ctrl+shift+F(footer) 栏目导航正跳转 alt+ctrl+shift+D(up) 栏目导航逆跳转
	 * alt+ctrl+shift+U(down);
	 */
	_EsdDynamicTransformationScript.navBlock.key.top = "alt+1"; // (top)
	_EsdDynamicTransformationScript.navBlock.key.nav = "alt+2"; // (nav)
	_EsdDynamicTransformationScript.navBlock.key.main = "alt+3"; // (main)
	_EsdDynamicTransformationScript.navBlock.key.content = "alt+4"; // (content)
	_EsdDynamicTransformationScript.navBlock.key.left = "alt+5"; // (left)
	_EsdDynamicTransformationScript.navBlock.key.right = "alt+6"; // (right)
	_EsdDynamicTransformationScript.navBlock.key.footer = "alt+7"; // (footer)
	_EsdDynamicTransformationScript.navBlock.key.down = "alt+8"; // (down)
	_EsdDynamicTransformationScript.navBlock.key.up = "alt+9"; // (up);


	// 以下变量主要用于区块跳转
	_EsdDynamicTransformationScript.navBlock.sIndex = -1; // 当前栏目下标
	_EsdDynamicTransformationScript.navBlock.maxIndex = -1; // 保存目前所有class="navBlock"的区域块总数量，栏目总量下标。
	_EsdDynamicTransformationScript.navBlock.minIndex = 0; // 栏目数量起始下标

	// 主要代码区域

	// 导航跳转
	_EsdDynamicTransformationScript.navBlock.keyShowSelect = function (i) {
	    $(_EsdDynamicTransformationScript.navBlock.selector.activate).each(function (index, el) {
	        if (i == index) {
	            _EsdDynamicTransformationScript.navBlock.debugView(el);
	            $(el).find("a").each(function (i, e) {
	                if (i == 0) {
	                    $(e).focus();
	                }
	            });

	        }
	    });
	}
	
	// 获取所有class=navBlock的区域的总数量，初始化轮训所有需要跳转的块
	$(_EsdDynamicTransformationScript.navBlock.selector.activate).each(function (index, ehx) {
	    _EsdDynamicTransformationScript.navBlock.maxIndex++;
	});

	// 前进
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.down, function () { // down
	    if (_EsdDynamicTransformationScript.navBlock.sIndex < _EsdDynamicTransformationScript.navBlock.maxIndex) {
	        _EsdDynamicTransformationScript.navBlock.sIndex++;
	        _EsdDynamicTransformationScript.navBlock.keyShowSelect(_EsdDynamicTransformationScript.navBlock.sIndex);
	    }
	    return false;
	});
	// 后退
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.up, function () { // up
	    if (_EsdDynamicTransformationScript.navBlock.sIndex > _EsdDynamicTransformationScript.navBlock.minIndex) {
	        _EsdDynamicTransformationScript.navBlock.sIndex--;
	        _EsdDynamicTransformationScript.navBlock.keyShowSelect(_EsdDynamicTransformationScript.navBlock.sIndex);
	    }
	    return false;
	});

	// 快捷键功能区域
	// 跳转到头部
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.top, function () {
	    _EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.top);
	    return false;
	});
	// 跳转到导航
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.nav, function () {
	    _EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.nav);
	    return false;
	});
	// 跳转到底部
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.footer, function () {
	    _EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.footer);
	    return false;
	});
	// 跳转到主要区域
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.main, function () {
	    _EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.main);
	    return false;
	});
	// 跳转到左区域
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.left, function () {
	    _EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.left);
	    return false;
	});

	// 跳转到右区域
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.right, function () {
	    _EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.right);
	    return false;
	});
	// 跳转到正文区域
	Mousetrap.bind(_EsdDynamicTransformationScript.navBlock.key.content, function () {
	    _EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.content);
	    return false;
	});

	// 特定区域跳转
	_EsdDynamicTransformationScript.navBlock.keySelectScroll = function (id) {
	    if ($(id).length > 0) {
	        _EsdDynamicTransformationScript.navBlock.debugView(id);
	        $(id).find("a").each(function (index) {
	            if (index == 0) {
	                $(this).focus();
	            }
	        });
	    } else {}

	}
	if (_EsdDynamicTransformationScript.navBlock.debug == true) {
	    // 如果开启调试模式，添加调试绘制矩形边线
	    $("body").append("<div id='show_top' class='lineshow'></div>");
	    $("body").append("<div id='show_bottom' class='lineshow'></div>");
	    $("body").append("<div id='show_left' class='lineshow'></div>");
	    $("body").append("<div id='show_right' class='lineshow'></div>");
	    $(".lineshow").css({
	        "display": "none"
	    });
	}
	// 开启调试模式后会显示红边
	_EsdDynamicTransformationScript.navBlock.debugView = function (e) {
	    if (_EsdDynamicTransformationScript.navBlock.debug == true) {
	        var x = $(e).offset();
	        var w = parseInt($(e).css("width")); ;
	        var h = parseInt($(e).css("height"));
	        $("#show_top").css({
	            "z-index": "9999",
	            "border": "red 2px solid",
	            "position": "absolute",
	            "top": x.top,
	            "left": x.left,
	            "width": w,
	            "height": "0px"
	        });
	        $("#show_bottom").css({
	            "z-index": "9999",
	            "border": "red 2px solid",
	            "position": "absolute",
	            "top": x.top + h,
	            "left": x.left,
	            "width": w,
	            "height": "0px"
	        });
	        $("#show_left").css({
	            "z-index": "9999",
	            "border": "red 2px solid",
	            "position": "absolute",
	            "top": x.top,
	            "left": x.left,
	            "width": "0px",
	            "height": h
	        });
	        $("#show_right").css({
	            "z-index": "9999",
	            "border": "red 2px solid",
	            "position": "absolute",
	            "top": x.top,
	            "left": x.left + w,
	            "width": "0px",
	            "height": h
	        });
	        $("html,body").animate({
	            scrollTop: $("#show_top").offset().top
	        }, 200);
	        $(".lineshow").css({
	            "display": "block"
	        });
	    }
	}
};
/**
 * 主入口方法
 */



if (window.jQuery == undefined) {
	var wzaInitInterval = setInterval(function(){	
		if(document.body!=null){
			clearInterval(wzaInitInterval);
			document.body.onload = function(){
				var esdJquery = document.createElement("script");
				esdJquery.setAttribute("type", "text/javascript");
				esdJquery.setAttribute("src", window.location.origin + "/wza/bwscript/jquery-1.12.4.min.js");
				esdJquery.setAttribute("charset", "utf-8");
				esdJquery.setAttribute("id", "ESDWebAppInnerIframe");
				esdJquery.onload = function () {
					_EsdDynamicTransformationFunction(jQuery);
				};
				document.head.appendChild(esdJquery);
			};	
		}
	}, 10);
} else {
	jQuery(function(){
		_EsdDynamicTransformationFunction(jQuery);
	})
	
}
